import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:dailypayagent/model/salescount.dart';
import 'package:quiver/strings.dart';

class SalesCountItemWidget extends StatelessWidget {
  final SalesCountItem item;
  SalesCountItemWidget(this.item);
  @override
  Widget build(BuildContext context) {
    var backgroundColor = Theme.of(context).scaffoldBackgroundColor;
    return Stack(children: <Widget>[
      Material(
        color: backgroundColor,
        child: Container(
          padding: const EdgeInsets.all(10),
          decoration: BoxDecoration(
              border: Border(
            bottom: Divider.createBorderSide(context, width: 0.7),
          )),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: <Widget>[
                  Text(
                    isNotBlank(item.saleName) ? item.saleName : '-',
                    style: Theme.of(context).textTheme.caption,
                  ),
                  Text(item.tradeAmount.toString() + '元'),
                  Text(item.saleName,
                      style: Theme.of(context).textTheme.caption),
                ],
              ),
            ],
          ),
        ),
      )
    ]);
  }
}
